package com.trs.entry;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;

@Entity
@Table(name = "cqdoc")
public class Doc {

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer id;
	private String sortIndex;
	private Integer localId;
	private String msgSvrID;
	private String userName;
	private String nickName;
	private String smallHeadImgUrl;
	private String bigHeadImgUrl;
	@Lob
	private String strContent;
	@Column(length = 4000)
	private String msgSource;
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") // 提交数据为@param
	@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss") // 提交数据为json
	@Temporal(TemporalType.TIMESTAMP) // @TemporalType.(DATE,TIME,TIMESTAMP)分别Map java.sql.(Date,Time, Timestamp).
	private Date createTime;// 发布时间
	private Integer isSender;
	private String type;
	private Integer subType;
	private String compressContent;

	private String wechat;
	private String groupid;
	private String groupname;
	@Column(columnDefinition = "INT default -5", nullable = false)
	private Integer issend;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getSortIndex() {
		return sortIndex;
	}

	public void setSortIndex(String sortIndex) {
		this.sortIndex = sortIndex;
	}

	public Integer getLocalId() {
		return localId;
	}

	public void setLocalId(Integer localId) {
		this.localId = localId;
	}

	public String getMsgSvrID() {
		return msgSvrID;
	}

	public void setMsgSvrID(String msgSvrID) {
		this.msgSvrID = msgSvrID;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getNickName() {
		return nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

	public String getSmallHeadImgUrl() {
		return smallHeadImgUrl;
	}

	public void setSmallHeadImgUrl(String smallHeadImgUrl) {
		this.smallHeadImgUrl = smallHeadImgUrl;
	}

	public String getBigHeadImgUrl() {
		return bigHeadImgUrl;
	}

	public void setBigHeadImgUrl(String bigHeadImgUrl) {
		this.bigHeadImgUrl = bigHeadImgUrl;
	}

	public String getStrContent() {
		return strContent;
	}

	public void setStrContent(String strContent) {
		this.strContent = strContent;
	}

	public String getMsgSource() {
		return msgSource;
	}

	public void setMsgSource(String msgSource) {
		this.msgSource = msgSource;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Integer getIsSender() {
		return isSender;
	}

	public void setIsSender(Integer isSender) {
		this.isSender = isSender;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Integer getSubType() {
		return subType;
	}

	public void setSubType(Integer subType) {
		this.subType = subType;
	}

	public String getCompressContent() {
		return compressContent;
	}

	public void setCompressContent(String compressContent) {
		this.compressContent = compressContent;
	}

	public String getWechat() {
		return wechat;
	}

	public void setWechat(String wechat) {
		this.wechat = wechat;
	}

	public String getGroupid() {
		return groupid;
	}

	public void setGroupid(String groupid) {
		this.groupid = groupid;
	}

	public String getGroupname() {
		return groupname;
	}

	public void setGroupname(String groupname) {
		this.groupname = groupname;
	}

	public Integer getIssend() {
		return issend;
	}

	public void setIssend(Integer issend) {
		this.issend = issend;
	}

	@Override
	public String toString() {
		return "Doc [id=" + id + ", sortIndex=" + sortIndex + ", localId=" + localId + ", msgSvrID=" + msgSvrID + ", userName=" + userName + ", nickName=" + nickName + ", smallHeadImgUrl=" + smallHeadImgUrl + ", bigHeadImgUrl=" + bigHeadImgUrl + ", strContent=" + strContent + ", msgSource=" + msgSource + ", createTime=" + createTime + ", isSender=" + isSender + ", type=" + type + ", subType=" + subType + ", compressContent=" + compressContent + ", wechat=" + wechat + ", groupid=" + groupid + ", groupname=" + groupname + ", issend=" + issend + "]";
	}

}
